const Router = require("@koa/router");
const labelRouter = new Router({ prefix: "/label" });

// 创建用户的中间件
const {
	create,
	list,
	update,
	remove
} = require("../controller/label.controller");

// 登录校验的中间件
const { verifyAuth } = require("../middleware/auth.middleware");
const labelRequest = require("../request/label.request");

// 创建标签
labelRouter.post("/", verifyAuth, labelRequest, create);
// 获取标签
labelRouter.get("/", list);
// 修改
labelRouter.patch("/:labelId", verifyAuth, labelRequest, update);
// 删除
labelRouter.delete("/:labelId", verifyAuth, remove);

module.exports = labelRouter;
